package com.ruoyi.back.domain

import com.baomidou.mybatisplus.annotation.*
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.springframework.format.annotation.DateTimeFormat
import java.util.*
import javax.persistence.*

@TableName("fly_open_advertising")
@ApiModel("广告参数")
@Entity
@Table(name = "fly_open_advertising")
data class OpenAdvertising(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    /**
     * 创建人
     */
    @ApiModelProperty(hidden = true)
    var createBy: Long? = 0L,

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(hidden = true)
    var createTime: Date? = null,

    /**
     * 更新人
     */
    @ApiModelProperty(hidden = true)
    var updateBy: Long? = 0L,

    /**
     * 更新时间
     */
    @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var updateTime: Date? = null,

    /**
     * 逻辑删除
     */
    @ApiModelProperty(hidden = true)
    @TableLogic
    var deleted: Int? = 0,

    @ApiModelProperty("广告类型: 1. 开屏广告 2.首页轮播 3.首页弹窗 4.漂浮广告 5. 个人中心")
    var advertisingType: Int? = null,

    @ApiModelProperty("标题")
    var title: String? = null,

    @ApiModelProperty("图片")
    var pic: String? = null,

    @ApiModelProperty("是否跳转")
    var jump: Boolean? = true,

    @ApiModelProperty("是否展示")
    var isShow: Boolean? = true,

    @ApiModelProperty("停留秒数")
    var staySeconds: Int? = null,

    @ApiModelProperty("链接方式 1.内部页面 2.外部链接")
    var urlStyle: Int? = null,

    @ApiModelProperty("链接")
    var url: String? = null,

    @ApiModelProperty("显示页面 1. 首页 2.记录 3.作品 4.我的")
    var showPage: Int? = null,

    @ApiModelProperty("停留秒数描述")
    @TableField(exist = false)
    var staySecondsDesc: String? = null,

    @ApiModelProperty("显示页面 1. 首页 2.记录 3. 我的 描述")
    @TableField(exist = false)
    var showPageDesc: String? = null,

    )
